<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8">
        <title>Managing Included Layers (Street View, Borders, etc...)</title>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js" type="text/javascript"></script>
        <script src="examples.js" type="text/javascript"></script>
        <script src="https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22earth%22%2C%22version%22%3A%221%22%7D%5D%7D&key=ABQIAAAAbEBR9v0lqBFdTfOcbe5WjRQPjtdHQ3xdBuNAR-KDFOW1mqdVsRRmZhmrl-MOSGS44M9Gug9FdssEgQ" type="text/javascript" charset="utf-8"></script>
        <script id="sample" type="text/example" charset="utf-8">
        
            var tree;

            $(document).ready(function(){
                google.earth.createInstance('map3d', init, failure);                
            });

            function init(ge) {
                ge.getWindow().setVisibility(true);
                var gex = gex = new GEarthExtensions(ge);
                
                var layers = kmltree({
                    url: './kml/includedLayers.kml',
                    gex: gex, 
                    element: $('#tree'),
                    mapElement: $('#map3d'),
                    setExtent: true,
                    supportItemIcon: true,
                    restoreState: true
                });
                
                layers.load();

                var options = kmltree({
                    url: './kml/displayOptions.kml',
                    gex: gex, 
                    element: $('#tree2'),
                    mapElement: $('#map3d'),
                    setExtent: true,
                    supportItemIcon: true,
                    restoreState: true
                });
                
                options.load();
                
                enableGoogleLayersControl(layers, ge);
                enableGoogleLayersControl(options, ge);
                
            }

            function failure(errorCode) {
                alert('failed to load plugin');
            }
            
        </script>
    </head>
    <body>
        <div class="content">
            <p class="description">
                This example shows how to control the visibility of the 
                built-in Google layers like Roads and display options like 
                Atmosphere and Street View.
            </p>            
        </div>
    </body>
</html>